package com.ruoyi.teaching.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.teaching.mapper.TeachingTeacherMapper;
import com.ruoyi.teaching.domain.TeachingTeacher;
import com.ruoyi.teaching.service.ITeachingTeacherService;

/**
 * 老师信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-03-21
 */
@Service
public class TeachingTeacherServiceImpl implements ITeachingTeacherService 
{
    @Autowired
    private TeachingTeacherMapper teachingTeacherMapper;

    /**
     * 查询老师信息
     * 
     * @param teacherId 老师信息主键
     * @return 老师信息
     */
    @Override
    public TeachingTeacher selectTeachingTeacherByTeacherId(Long teacherId)
    {
        return teachingTeacherMapper.selectTeachingTeacherByTeacherId(teacherId);
    }

    /**
     * 查询老师信息列表
     * 
     * @param teachingTeacher 老师信息
     * @return 老师信息
     */
    @Override
    public List<TeachingTeacher> selectTeachingTeacherList(TeachingTeacher teachingTeacher)
    {
        return teachingTeacherMapper.selectTeachingTeacherList(teachingTeacher);
    }

    /**
     * 新增老师信息
     * 
     * @param teachingTeacher 老师信息
     * @return 结果
     */
    @Override
    public int insertTeachingTeacher(TeachingTeacher teachingTeacher)
    {
        teachingTeacher.setCreateTime(DateUtils.getNowDate());
        return teachingTeacherMapper.insertTeachingTeacher(teachingTeacher);
    }

    /**
     * 修改老师信息
     * 
     * @param teachingTeacher 老师信息
     * @return 结果
     */
    @Override
    public int updateTeachingTeacher(TeachingTeacher teachingTeacher)
    {
        teachingTeacher.setUpdateTime(DateUtils.getNowDate());
        return teachingTeacherMapper.updateTeachingTeacher(teachingTeacher);
    }

    /**
     * 批量删除老师信息
     * 
     * @param teacherIds 需要删除的老师信息主键
     * @return 结果
     */
    @Override
    public int deleteTeachingTeacherByTeacherIds(Long[] teacherIds)
    {
        return teachingTeacherMapper.deleteTeachingTeacherByTeacherIds(teacherIds);
    }

    /**
     * 删除老师信息信息
     * 
     * @param teacherId 老师信息主键
     * @return 结果
     */
    @Override
    public int deleteTeachingTeacherByTeacherId(Long teacherId)
    {
        return teachingTeacherMapper.deleteTeachingTeacherByTeacherId(teacherId);
    }
}
